Open
Conversation
…on and Docker setup
…ent, add user and trip models, and implement database initialization script.
… generate default itinerary
Update container files
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Flask-based REST API for the Planventure application with full support for user authentication, trip management, and a development environment built on Docker and GitHub Codespaces. Key changes include:
- Implementation of authentication routes (registration and login) using JWT tokens.
- Creation of SQLAlchemy models for User and Trip along with middleware for token verification.
- Enhancements to configuration, documentation, and development container setup.
Reviewed Changes
Copilot reviewed 24 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| planventure-api/routes/auth.py | Added authentication endpoints with proper error responses and JWT flows. |
| planventure-api/models/user.py | Defined User model with password hashing and JWT token generation. |
| planventure-api/models/trip.py | Added Trip model and established relationship with User. |
| planventure-api/middleware/auth.py | Introduced middleware for verifying JWTs and checking user existence. |
| planventure-api/app.py | Configured Flask app with CORS, JWT callbacks, and blueprint registration. |
| Others (README, config, etc.) | Updated documentation and environment configuration files for the API. |
Files not reviewed (4)
- .devcontainer/Dockerfile: Language not supported
- .devcontainer/devcontainer.json: Language not supported
- planventure-api/.env.example: Language not supported
- planventure-api/requirements.txt: Language not supported
Comments suppressed due to low confidence (1)
planventure-api/models/user.py:31
- [nitpick] The identity is wrapped in a tuple unnecessarily; passing the string directly (as in create_access_token(identity=str(self.id))) may help avoid potential type mismatches downstream.
return create_access_token(identity=(str(self.id)))
| def decorated(*args, **kwargs): | ||
| try: | ||
| verify_jwt_in_request() | ||
| current_user_id = get_jwt_identity() |
There was a problem hiding this comment.
The auth middleware retrieves the user ID as a string (from create_access_token), but the User model's primary key is an integer. Consider converting current_user_id to an integer (e.g., int(get_jwt_identity())) to ensure proper query matching.
Suggested change
| current_user_id = get_jwt_identity() | |
| current_user_id = int(get_jwt_identity()) |
…reSQL; update README and add security guidelines
…anventure-api directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
renamed branch to
api-completeThis pull request introduces a new Flask-based REST API for the Planventure application, along with a complete development environment setup using Docker and GitHub Codespaces. Key changes include the creation of the API, its supporting infrastructure, and updates to documentation and configuration files.